package inet.app.tuvi.util;

import android.app.Activity;
import android.os.IBinder;
import android.view.View;
import android.view.inputmethod.InputMethodManager;

public class KeyboardUtil {

	/**
	 * Use to hide keyboard system
	 * @param activity
	 */
	public static void hideSoftKeyboard(Activity activity) {
		InputMethodManager inputMethodManager = (InputMethodManager) activity
				.getSystemService(Activity.INPUT_METHOD_SERVICE);
		View view = activity.getCurrentFocus();
		if (view != null) {
			IBinder binder = view.getWindowToken();
			if (binder != null) {
				inputMethodManager.hideSoftInputFromWindow(binder, 0);
			}
		}

	}
}